package com.ws.exer1;

/*
*写一个测试程序。
( 1)创建一个 Customer ，名字叫 Jane Smith,
他有一个账号为 1000，余额为 2000元，年利率为 1.23% 的账户。
(2）对 Jane Smith操作。
存入 100 元，再取出 960 元。再取出 2000元。打印出 Jane Smith 的基本信息
成功存入:100.0
成功取出:960.0
余额不足，取款失败

 */
public class CustomerTest {
    public static void main(String[] args) {

        Customer customer = new Customer("Jane", "Smith");

        Account account = new Account(1000, 2000, 1.23);

        customer.setAccount(account);

        customer.getAccount().deposit(100);
        customer.getAccount().withDraw(960);
        customer.getAccount().withDraw(2000);

        System.out.println("Customer [" + customer.getFirstName() + ", " + customer.getLastName()
        + "] has a account: id is " + account.getId() + ", annualInterestRate is " + account.getAnnulInterestRate()
                +"%, balance is " + account.getBalance());


    }
}
